package chabernac.android.wordraster.rastersolver;

import java.util.ArrayList;
import java.util.List;

public class CompositeWordFilter implements iWordFilter {
  
  private final List<iWordFilter> myFilters = new ArrayList<iWordFilter>();
  
  public CompositeWordFilter addFilter(iWordFilter aFilter){
    myFilters.add(aFilter);
    return this;
  }

  @Override
  public boolean isValidWord(String aWord) {
    for(iWordFilter theFilter : myFilters){
      if(!theFilter.isValidWord(aWord)) return false;
    }
    return true;
  }

}
